package org.lboot.idmo.module.user;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.lboot.idmo.converter.EncryptConverter;
import org.lboot.jpa.entity.LongBaseEntity;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@EqualsAndHashCode(callSuper = true)
@Data
@Entity
@Table(name = "sys_user")
@ApiModel(value = "用户信息实体",description = "用户实体信息管理")
public class SysUser extends LongBaseEntity implements Serializable {
    @ApiModelProperty("部门ID")
    @Column(name = "dept_id")
    Long deptId;

    @ApiModelProperty("用户名")
    @Column(name = "username",length = 64)
    private String username;

    @ApiModelProperty("用户昵称")
    @Column(name = "nickname",length = 64)
    private String nickname;

    @ApiModelProperty("用户手机号")
    @Column(name = "mobile")
    String mobile;

    /** 用户邮箱 & 用户登录账号 **/
    @ApiModelProperty("用户邮箱")
    @Column(name = "email")
    String email;

    /**
     * 身份证
     */
    @ApiModelProperty("证件号码")
    @Convert(converter = EncryptConverter.class)
    @Column(name = "card_id")
    private String cardId;

    /**
     * 用户性别 可选 男 女 第三性别
     */
    @ApiModelProperty("用户性别")
    @Column(name = "sex")
    private String sex;

    /**
     * 用户头像地址 OSS
     */
    @ApiModelProperty("用户头像")
    @Column(name = "avatar",length = 512)
    private String avatar;


    @ApiModelProperty(value = "账户类型")
    @Column(name = "user_type")
    private String userType;

    /**
     * 账号状态 可选 0 正常！ 1 禁用
     */
    @ApiModelProperty("账号状态")
    @Column(name = "status",nullable = false)
    private Integer status;

    /** 用户登录密码 & 用户隐私数据 **/
    @Convert(converter = EncryptConverter.class)
    @ApiModelProperty("用户登录密码")
    @Column(name = "password")
    String password;

    /**
     * 拓展参数
     */
    @ApiModelProperty("拓展参数")
    @Column(name = "ext_params",length = 2048)
    String extParams;
}
